<template>
    <view class="page">
        <!-- 使用数组解构：[id, article] -->
        <uni-card 
            :is-shadow="true" 
            v-for="([id, article], index) in filteredArticles" 
            :key="index" 
            @click="goToDetail(id)"
        >
            <text class="uni-body">{{ article.title }}</text>
        </uni-card>
    </view>
</template>

<script>

export default {
    onLoad(options) {
        
        const category = options.category;
        //  查找与当前分类匹配的文章
        // 确保 articles 是一个对象


        
    },
    data() {
        return {
            filteredArticles: []
        }
    },
    methods: {
        goToDetail (id){
            uni.navigateTo({
                url:`textDetail?index=${id}`
            })
        },

    }
}
</script>

<style scoped lang="scss"></style>